GdkGLContext: Fix damage computation with buffer_age
authorTimm Bäder <mail@baedert.org>
Fri, 30 Nov 2018 12:14:00 +0000 (13:14 +0100)
committerTimm Bäder <mail@baedert.org>
Sun, 2 Dec 2018 12:25:43 +0000 (13:25 +0100)
commit94745241c2957794cbc1ad308f749d5d3bc7e702
treeaedddd58a3f3914a00083e492d44d3c94b3f345f
parent538491efa1d0124176c005ff33fb6e8b27378b94
GdkGLContext: Fix damage computation with buffer_age

As per the spec:

> The back buffer can
> either be reported as invalid (has an age of 0) or it may be
> reported to contain the contents from n frames prior to the
> current frame.

So a  buffer age of 1 means that the buffer was used in the last frame.
We were handling buffer_age==1 the same as buffer_age==0, i.e. we
returned the full damage for the surface.

[1] https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_buffer_age.txt
gdk/wayland/gdkglcontext-wayland.c
gdk/x11/gdkglcontext-x11.c